<%@ Page Language="C#" MasterPageFile="~/SFMaster.master" AutoEventWireup="true"
    CodeFile="Articles.aspx.cs" Inherits="Admin_Articles" ValidateRequest="false"  %>

<%@ Register Assembly="WebControls" Namespace="WebControls" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderMain" runat="Server">
<table width=100%><tr><td>
    <cc1:SFGrid ID="sfgArticles" runat="server" OnNeedsDataSource="sfgArticles_NeedsDataSource"
        AutoGenerateColumns="False" IsMasterPageControl="False" IsProtectedForLanguageChange="False"
        OnRowCommand="sfgArticles_RowCommand">
        <Columns>
            <asp:TemplateField>
                <itemtemplate>
                <asp:ImageButton id="ibtEdit" runat="server" CommandName="EditData" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"ArticleId") %>' ImageUrl="~/images/edit.gif"></asp:ImageButton>
            </itemtemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <itemtemplate>
                <asp:ImageButton id="ibtDelete" runat="server" CommandName="DeleteData" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"ArticleId") %>' ImageUrl="~/images/delete.gif"></asp:ImageButton>
            </itemtemplate>
            </asp:TemplateField>
             <asp:BoundField DataField="ArticleDescription"></asp:BoundField>
            <asp:BoundField DataField="PublishDate"  DataFormatString="{0:d}" HtmlEncode="false"></asp:BoundField>
           
        </Columns>
    </cc1:SFGrid>
    <cc1:SFButton ID="btnNew" runat="server" OnClick="btnNew_Click" /></td></tr></table>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderEdit" runat="Server">
    <table>
        <tr>
            <td>
                <cc1:SFLabel ID="lblArticleDescription" runat="server"></cc1:SFLabel>
            </td>
            <td>
                <cc1:SFTextBox ID="txtArticleDescription" runat="server" ControlsLabel="lblArticleDescription"></cc1:SFTextBox>
            </td>
        </tr>
        <tr>
            <td>
                <cc1:SFLabel ID="lblPublishDate" runat="server"></cc1:SFLabel>
            </td>
            <td>
                <cc1:SFCalendar ID="calPublishDate" runat="server" ControlsLabel="lblPublishDate"></cc1:SFCalendar>
            </td>
        </tr>
        <tr>
            <td>
                <cc1:SFLabel ID="lblArticleCategories" runat="server"></cc1:SFLabel>
            </td>
            <td>
                <cc1:SFCheckBoxList ID="sfcArticleCategories" runat="server" ControlsLabel="lblArticleCategories">
                </cc1:SFCheckBoxList>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <cc1:SFDataList ID="lstArticles" runat="server" DataKeyField="ArticleContentId" OnNeedsDataSource="lstArticles_NeedsDataSource"
                    OnItemDataBound="lstArticles_ItemDataBound">
                    <ItemTemplate>
                        <table>
                            <tr>
                                <td valign="top">
                                    <cc1:SFCheckBox AutoPostBack="true" OnCheckedChanged="Check" ID="chkLanguage" runat="server"
                                        Text='<%#DataBinder.Eval(Container.DataItem,"LanguageName") %>' />
                                </td>
                                </tr><tr>
                                <td valign="top">
                                    <asp:Panel ID="pnlArticleContents" runat="server">
                                        <table>
                                            <tr>
                                                <td valign="top">
                                                    <cc1:SFLabel ID="lblArticleTitle" runat="server"></cc1:SFLabel>
                                                </td>
                                                <td>
                                                    <cc1:SFTextBox ID="txtArticleTitle" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"ArticleTitle") %>' ControlsLabel="lblArticleTitle"></cc1:SFTextBox>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td valign="top">
                                                    <cc1:SFLabel ID="lblArticleSummary" runat="server"></cc1:SFLabel>
                                                </td>
                                                <td>
                                              
                                                </td>
                                            </tr>
                   
                                                <td colspan=2>
                                                     <cc1:SFEditor ID="ediArticleSummary" ControlsLabel="lblArticleSummary" EditorHeight="130px" Width="450px" runat="server" HTML='<%#DataBinder.Eval(Container.DataItem,"ArticleSummary") %>'>
                                                    </cc1:SFEditor>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td valign="top">
                                                    <cc1:SFLabel ID="lblArticleBody" runat="server"></cc1:SFLabel>
                                                </td>
                                                <td>
                                              
                                                </td>
                                            </tr>
                                             <tr>
                    
                                                <td colspan=2>
                                                  <cc1:SFEditor ID="ediArticleBody" ControlsLabel="lblArticleBody" width="450px" runat="server" HTML='<%#DataBinder.Eval(Container.DataItem,"ArticleBody") %>'>
                                                    </cc1:SFEditor>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td valign="top">
                                                    <cc1:SFLabel ID="lblArticleContentPublishLocations" runat="server"></cc1:SFLabel>
                                                </td>
                                                <td>
                                                   <cc1:SFTextBox ID="txtArticleContentPublishLocations" ControlsLabel="lblArticleContentPublishLocations" AllowNull="true" width="340px" TextMode="MultiLine" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"ArticleContentPublishLocations") %>'></cc1:SFTextBox>
                                                </td>
                                            </tr>
                                        </table>
                                    </asp:Panel>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                    <SeparatorTemplate>
                    <hr />
                    </SeparatorTemplate>
                </cc1:SFDataList>
            </td>
        </tr>
    </table>
</asp:Content>
